; Music of Espionage (1988) (Grandslam) (Source)
; Ripped by Megachur the 08/04/2009

	write "ESPIONAG.BIN"

music_date_rip	equ &0849
music_adr	equ &7e42
first_theme	equ 0
last_theme	equ 0	; 0 -> 0

	read "music_header_v1_0.asm"

;
.play_music
;
	ld a,(l814e)
	ld c,a
	ld a,#07
	call l8124
	ld a,(l7eb6)
	or a
	jp p,l7e9a
;
.init_music
;
	and #03
	ld (l7eb6),a
	add a
	add a
	add a
	ld e,a
	ld d,#00
	ld hl,l7eb7
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	xor a
	ld (l7ec7),de
	ld (l7ec9),a
	ld (l7eca),a
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l7ed9),de
	ld (l7edb),a
	ld (l7edc),a
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l7ee7),de
	ld (l7ee9),a
	ld (l7eea),a
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (l7ef5),de
	ld (l7ef7),a
	ld (l7ef8),a
.l7e9a
	ld ix,l7ec7
	call l7fdc
	ld ix,l7ed9
	call l7fdc
	ld ix,l7ee7
	call l7fdc
	ld ix,l7ef5
	jp l7fdc
.l7eb6
	db #00
.l7eb7
	dw l83ce,l8561,l83ce,l814f
	db #00,#00,#00,#00,#00,#00,#00,#00
.l7eca equ $ + 3
.l7ec9 equ $ + 2
.l7ec7
	db #00,#00,#00,#00,#0c,#01,#00,#00
	db #0f,#7f,#00,#00,#00,#00,#00,#00
.l7edc equ $ + 5
.l7edb equ $ + 4
.l7ed9 equ $ + 2
	db #00,#00,#00,#00,#00,#00,#18,#02
	db #00,#00,#03,#7f,#00,#00,#00,#00
.l7eea equ $ + 3
.l7ee9 equ $ + 2
.l7ee7
	db #00,#00,#00,#00,#0c,#03,#00,#00
.l7ef5 equ $ + 6
	db #00,#00,#00,#00,#00,#00,#00,#00
.l7ef8 equ $ + 1
.l7ef7
	db #00,#00,#18,#04,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#01
	db #10,#00,#01,#f0,#ff,#ff,#03,#7f
	db #00,#00,#00,#01,#01,#00,#01,#ff
	db #ff,#ff,#0f,#7f
.l7f1b
	dw #0eee,#0e18,#0d4d,#0c8e
	dw #0bda,#0b2f,#0a8f,#09f7
	dw #0968,#08e1,#0861,#07e9
	dw #0777,#070c,#06a7,#0647
	dw #05ed,#0598,#0547,#04fc
	dw #04b4,#0470,#0431,#03f4
	dw #03bc,#0386,#0353,#0324
	dw #02f6,#02cc,#02a4,#027e
	dw #025a,#0238,#0218,#01fa
	dw #01de,#01c3,#01aa,#0192
	dw #017b,#0166,#0152,#013f
	dw #012d,#011c,#010c,#00fd
	dw #00ef,#00e1,#00d5,#00c9
	dw #00be,#00b3,#00a9,#009f
	dw #0096,#008e,#0086,#007f
	dw #0077,#0071,#006a,#0064
	dw #005f,#0059,#0054,#0050
	dw #004b,#0047,#0043,#003f
	dw #003c,#0038,#0035,#0032
	dw #002f,#002d,#002a,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001c,#001b,#0019
	dw #0018,#0016,#0015,#0014
	dw #0013,#0012,#0011,#0010
.l7fdb
	db #01
.l7fdc
	ld a,(l7fdb)
	dec a
	or a
	jp nz,l7fec
	ld a,#07
	ld c,#38
	call l8124
	xor a
.l7fec
	ld (l7fdb),a
	ld l,(ix+#06)
	ld h,(ix+#07)
	ld a,h
	or l
	jp z,l7ffa
.l7ffa
	ld l,(ix+#08)
	ld h,(ix+#09)
	ld a,h
	or l
	jp z,l8051
	ld a,(ix+#0a)
	or a
	jp z,l8032
	dec a
	ld (ix+#0a),a
	inc hl
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld l,(ix+#0d)
	ld h,(ix+#0c)
	add hl,de
	ld (ix+#0c),h
	ld (ix+#0d),l
	ld a,(ix+#05)
	dec a
	add a
	ld c,l
	call l8124
	inc a
	ld c,h
	call l8124
	jp l8051
.l8032
	inc hl
	inc hl
	inc hl
	ld a,(hl)
	cp #ff
	jp nz,l8048
	inc hl
	ld a,(hl)
	ld (ix+#08),a
	inc hl
	ld a,(hl)
	ld (ix+#09),a
	jp l7ffa
.l8048
	ld (ix+#0a),a
	ld (ix+#08),l
	ld (ix+#09),h
.l8051
	jp l8111
.l8054
	ld a,(ix+#05)
	cp #04
	jp z,l8066
	ld a,(ix+#05)
	add #07
	ld c,#00
	call l8124
.l8066
	ld l,(ix+#00)
	ld h,(ix+#01)
	ld a,l
	or h
	jp z,l8123
.l8071
	ld a,(hl)
	cp #ff
	jr nz,l8082
	inc hl
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (ix+#00),e
	ld (ix+#01),d
	jr l8066
.l8082
	cp #80
	jr nz,l808f
	inc hl
	ld e,(hl)
	inc hl
	ld (ix+#02),e
	jp l810b
.l808f
	cp #81
	jr nz,l809b
	inc hl
	ld a,(hl)
	inc hl
	ld (ix+#03),a
	jr l8071
.l809b
	sub (ix+#04)
	ex af,af'
	ld a,(ix+#05)
	cp #04
	jp z,l80d6
	ex af,af'
	push hl
	ld h,#00
	ld l,a
	add hl,hl
	ld de,l7f1b
	add hl,de
	ld a,(ix+#05)
	dec a
	add a
	push af
	ld c,(hl)
	ld (ix+#0d),c
	inc hl
	call l8124
	pop af
	inc a
	ld c,(hl)
	ld (ix+#0c),c
	call l8124
	ld a,(ix+#05)
	add #07
	ld c,#0f
	call l8124
	pop hl
	jp l8105
.l80d6
	ex af,af'
	cp #10
	jp z,l80f2
	ld a,#06
	ld c,#02
	call l8124
	ld a,#07
	ld c,#00
	call l8124
	ld a,#01
	ld (l7fdb),a
	jp l8105
.l80f2
	ld a,#06
	ld c,#18
	call l8124
	ld a,#07
	ld c,#00
	call l8124
	ld a,#02
	ld (l7fdb),a
.l8105
	inc hl
	ld a,(hl)
	inc hl
	ld (ix+#02),a
.l810b
	ld (ix+#00),l
	ld (ix+#01),h
.l8111
	ld l,(ix+#02)
	ld h,(ix+#03)
	ld a,h
	or l
	jp z,l8054
	dec hl
	ld (ix+#02),l
	ld (ix+#03),h
.l8123
	ret
.l8124
	push af
	cp #07
	jr nz,l812f
	ld a,c
	ld (l814e),a
	ld a,#07
.l812f
	ld b,#f4
	out (c),a
	ld b,#f6
	in a,(c)
	or #c0
	out (c),a
	and #3f
	out (c),a
	ld b,#f4
	out (c),c
	ld b,#f6
	ld c,a
	or #80
	out (c),a
	out (c),c
	pop af
	ret
.l814f equ $ + 1
.l814e
	db #00,#80,#01,#24,#04,#80,#11,#24
	db #06,#80,#11,#24,#06,#80,#11,#24
	db #05,#80,#11,#24,#06,#80,#11,#24
	db #06,#80,#10,#24,#06,#80,#11,#24
	db #06,#80,#11,#24,#05,#80,#06,#80
	db #0b,#24,#06,#80,#11,#24,#06,#80
	db #11,#24,#05,#80,#11,#24,#06,#80
	db #0b,#80,#06,#24,#05,#80,#11,#24
	db #06,#80,#11,#24,#06,#80,#11,#24
	db #05,#80,#11,#24,#06,#80,#11,#24
	db #05,#80,#11,#24,#06,#80,#11,#24
	db #06,#80,#11,#24,#05,#80,#11,#24
	db #06,#80,#11,#24,#05,#80,#11,#24
	db #06,#80,#11,#24,#06,#80,#05,#80
	db #0c,#24,#05,#80,#11,#24,#06,#80
	db #11,#24,#06,#80,#10,#24,#06,#80
	db #0b,#80,#06,#24,#06,#80,#11,#24
	db #05,#80,#11,#24,#0c,#80,#0b,#28
	db #0e,#80,#08,#80,#01,#24,#05,#80
	db #06,#24,#07,#80,#04,#28,#10,#80
	db #07,#24,#0b,#80,#0b,#28,#10,#80
	db #07,#24,#05,#80,#06,#24,#08,#80
	db #04,#28,#0f,#80,#07,#24,#09,#80
	db #0e,#28,#0e,#80,#08,#24,#06,#80
	db #05,#80,#01,#24,#07,#80,#04,#28
	db #0f,#80,#08,#24,#09,#80,#0d,#28
	db #0e,#80,#09,#24,#06,#80,#05,#24
	db #07,#80,#05,#28,#0c,#80,#0a,#24
	db #0c,#80,#0b,#28,#0e,#80,#08,#24
	db #05,#80,#07,#24,#07,#80,#03,#80
	db #01,#28,#10,#80,#06,#24,#0c,#80
	db #0b,#28,#10,#80,#07,#24,#05,#80
	db #06,#24,#08,#80,#03,#28,#10,#80
	db #07,#24,#09,#80,#0d,#28,#0e,#80
	db #09,#24,#05,#80,#06,#24,#08,#80
	db #04,#28,#0f,#80,#07,#24,#0a,#80
	db #0d,#28,#0e,#80,#08,#24,#07,#80
	db #05,#24,#07,#80,#04,#28,#0d,#80
	db #03,#80,#07,#24,#05,#80,#11,#24
	db #06,#80,#11,#24,#05,#80,#12,#24
	db #05,#80,#10,#80,#01,#24,#06,#80
	db #11,#24,#05,#80,#11,#24,#06,#80
	db #11,#24,#06,#80,#10,#24,#06,#80
	db #11,#24,#06,#80,#11,#24,#05,#80
	db #11,#24,#06,#80,#11,#24,#06,#80
	db #04,#80,#0d,#24,#05,#80,#11,#24
	db #06,#28,#06,#28,#05,#28,#06,#28
	db #05,#28,#06,#28,#06,#28,#05,#24
	db #0c,#80,#04,#80,#07,#28,#0f,#80
	db #08,#24,#0d,#80,#09,#28,#05,#80
	db #06,#28,#0a,#80,#02,#24,#0b,#80
	db #0a,#80,#02,#28,#11,#80,#05,#24
	db #0e,#80,#09,#28,#05,#80,#06,#28
	db #09,#80,#02,#24,#0f,#80,#08,#28
	db #13,#80,#03,#24,#10,#80,#07,#28
	db #06,#80,#05,#28,#0a,#80,#02,#24
	db #0e,#80,#08,#28,#12,#80,#05,#24
	db #05,#80,#06,#24,#08,#80,#04,#28
	db #10,#80,#06,#24,#0b,#80,#0c,#28
	db #0e,#80,#01,#80,#07,#24,#0d,#80
	db #0a,#28,#05,#80,#06,#28,#0a,#80
	db #02,#24,#0c,#80,#0a,#28,#12,#80
	db #03,#80,#02,#24,#0d,#80,#0a,#28
	db #04,#80,#07,#28,#09,#80,#02,#24
	db #0e,#80,#09,#28,#12,#80,#04,#24
	db #0f,#80,#08,#28,#05,#80,#06,#28
	db #0a,#80,#01,#24,#0f,#80,#08,#28
	db #12,#80,#05,#24,#05,#80,#04,#80
	db #02,#24,#08,#80,#03,#28,#11,#80
	db #06,#24,#0b,#80,#0c,#28,#0e,#80
	db #08,#24,#0d,#80,#02,#80,#08,#28
	db #05,#80,#06,#28,#09,#80,#02,#24
	db #0c,#80,#0b,#28,#12,#80,#05,#24
	db #0d,#80,#07,#80,#02,#28,#05,#80
	db #06,#28,#0a,#80,#02,#24,#0e,#80
	db #08,#28,#13,#80,#04,#24,#0f,#80
	db #08,#28,#05,#80,#06,#28,#0a,#80
	db #01,#24,#0e,#80,#09,#28,#11,#80
	db #05,#24,#05,#80,#07,#24,#08,#80
	db #03,#28,#10,#80,#09,#ff,#4f,#81
.l83ce
	db #80,#01,#40,#94,#80,#09,#45,#0b
	db #43,#5c,#80,#0a,#47,#08,#80,#03
	db #47,#0a,#80,#46,#40,#95,#80,#09
	db #45,#0b,#43,#5c,#80,#0a,#47,#08
	db #80,#03,#47,#0a,#80,#12,#80,#33
	db #45,#06,#80,#06,#45,#0b,#47,#0b
	db #45,#0c,#48,#0b,#45,#0b,#4a,#0b
	db #45,#0c,#4c,#0b,#45,#0b,#4a,#0c
	db #45,#0b,#48,#0b,#45,#0c,#47,#0b
	db #48,#0b,#45,#06,#80,#05,#45,#0c
	db #47,#0b,#45,#0b,#48,#0c,#45,#0b
	db #4a,#0b,#45,#0c,#4c,#0b,#45,#0b
	db #4a,#0c,#45,#0b,#48,#0b,#45,#0c
	db #47,#0b,#48,#0b,#47,#06,#80,#05
	db #47,#0c,#49,#0b,#47,#0b,#4a,#0c
	db #47,#0b,#4c,#0b,#47,#0b,#4e,#0c
	db #47,#0b,#4c,#0b,#47,#0c,#4a,#0b
	db #47,#0b,#49,#0b,#4a,#0c,#47,#05
	db #80,#06,#47,#0b,#49,#0c,#47,#0b
	db #4a,#0b,#47,#0c,#4c,#0b,#47,#0b
	db #4e,#0c,#47,#0b,#4c,#0b,#47,#0b
	db #4a,#0c,#47,#0b,#49,#0b,#4a,#0c
	db #80,#59,#80,#60,#80,#60,#80,#50
	db #45,#0c,#45,#0b,#47,#0b,#45,#0c
	db #48,#0b,#45,#0b,#4a,#0b,#45,#0c
	db #4c,#0b,#45,#0c,#4a,#0b,#45,#0b
	db #48,#0b,#45,#0c,#47,#0b,#48,#0b
	db #45,#0b,#45,#0c,#47,#0b,#45,#0b
	db #48,#0c,#45,#0b,#4a,#0b,#45,#0c
	db #4c,#0b,#45,#0b,#4a,#0c,#45,#0b
	db #48,#0b,#45,#0c,#47,#0b,#48,#0b
	db #5d,#22,#5b,#06,#59,#05,#5b,#22
	db #59,#06,#58,#05,#80,#01,#59,#21
	db #58,#06,#56,#06,#58,#21,#80,#01
	db #56,#05,#54,#06,#56,#0b,#54,#06
	db #53,#06,#54,#0b,#53,#06,#51,#05
	db #53,#0b,#51,#06,#4f,#06,#51,#0b
	db #4f,#06,#4d,#05,#4f,#0c,#4d,#05
	db #4c,#06,#4d,#0b,#4c,#06,#4a,#06
	db #4c,#0b,#4a,#05,#80,#01,#48,#05
	db #4a,#0c,#48,#0a,#80,#01,#58,#22
	db #56,#05,#54,#06,#56,#22,#54,#06
	db #53,#05,#54,#22,#53,#06,#51,#06
	db #53,#21,#51,#06,#4f,#06,#51,#0b
	db #4f,#06,#4e,#05,#4f,#0c,#4e,#05
	db #4c,#06,#4e,#0b,#4c,#06,#4a,#06
	db #4c,#0b,#4a,#05,#48,#06,#4a,#0b
	db #48,#06,#47,#06,#48,#0b,#47,#06
	db #45,#05,#47,#0c,#45,#04,#80,#01
	db #43,#06,#45,#0b,#43,#0b,#80,#03
.l8561 equ $ + 3
	db #ff,#ce,#83,#80,#01,#34,#0a,#34
	db #0b,#36,#0c,#34,#0b,#37,#0b,#34
	db #0c,#39,#0b,#37,#0b,#34,#0c,#34
	db #0b,#36,#0b,#34,#0b,#37,#0c,#34
	db #0b,#39,#0b,#37,#0c,#34,#0b,#34
	db #0b,#36,#0c,#34,#0b,#37,#0b,#34
	db #0c,#39,#0b,#37,#0b,#34,#0b,#34
	db #0c,#36,#0b,#34,#0b,#37,#0c,#34
	db #0b,#39,#0b,#37,#0c,#34,#0b,#34
	db #0b,#36,#0c,#34,#0b,#37,#0b,#34
	db #0b,#39,#0c,#37,#0b,#34,#0b,#34
	db #0c,#36,#0b,#34,#0b,#37,#0b,#34
	db #0c,#39,#0b,#37,#0b,#34,#0c,#34
	db #0b,#36,#0b,#34,#0c,#37,#0b,#34
	db #0b,#39,#0c,#37,#0b,#34,#0b,#34
	db #0b,#36,#0c,#34,#0b,#37,#0b,#34
	db #0c,#39,#0b,#37,#0b,#39,#0c,#39
	db #0b,#3b,#0b,#39,#0c,#3c,#0b,#39
	db #0b,#3e,#0b,#3c,#0c,#39,#0b,#39
	db #0b,#3b,#0c,#39,#0b,#3c,#0b,#39
	db #0c,#3e,#0b,#3c,#0b,#39,#0b,#39
	db #0c,#3b,#0b,#39,#0b,#3c,#0c,#39
	db #0b,#3e,#0b,#3c,#0c,#39,#0b,#39
	db #0b,#3b,#0c,#39,#0b,#3c,#0b,#39
	db #0c,#3e,#0b,#3c,#0b,#3b,#0b,#3b
	db #0c,#3d,#0b,#3b,#0b,#3e,#0c,#3b
	db #0b,#40,#0b,#3e,#0b,#3b,#0c,#3b
	db #0b,#3d,#0b,#3b,#0c,#3e,#0b,#3b
	db #0b,#40,#0b,#3e,#0c,#3b,#0b,#3b
	db #0b,#3d,#0c,#3b,#0b,#3e,#0b,#3b
	db #0c,#40,#0b,#3e,#0b,#3b,#0c,#3b
	db #0b,#3d,#0b,#3b,#0b,#3e,#0c,#3b
	db #0b,#40,#0b,#3e,#0c,#34,#05,#80
	db #06,#34,#0b,#36,#0c,#34,#0b,#37
	db #0b,#34,#0c,#39,#0b,#34,#0b,#3b
	db #0b,#34,#0c,#39,#0b,#34,#0b,#37
	db #0c,#34,#0b,#36,#0b,#37,#0b,#34
	db #06,#80,#06,#34,#0b,#36,#0b,#34
	db #0c,#37,#0b,#34,#0b,#39,#0c,#34
	db #0b,#3b,#0b,#34,#0c,#39,#0b,#34
	db #0b,#37,#0c,#34,#0b,#36,#0b,#37
	db #0b,#39,#06,#80,#06,#39,#0b,#3b
	db #0b,#39,#0c,#3c,#0b,#39,#0b,#3e
	db #0b,#3c,#0c,#39,#06,#80,#05,#39
	db #0c,#3b,#0b,#39,#0b,#3c,#0b,#39
	db #0c,#3e,#0b,#3c,#0b,#39,#06,#80
	db #05,#39,#0c,#3b,#0b,#39,#0b,#3c
	db #0c,#39,#0b,#3e,#0b,#39,#0c,#40
	db #0b,#39,#0b,#3e,#0c,#39,#0b,#3c
	db #0b,#39,#0c,#3b,#0b,#3c,#0b,#39
	db #06,#80,#05,#39,#0c,#3b,#0b,#39
	db #0b,#3c,#0c,#39,#0b,#3e,#0b,#3c
	db #0c,#39,#05,#80,#06,#39,#0b,#3b
	db #0b,#39,#0c,#3c,#0b,#39,#0c,#3e
	db #0b,#3c,#0b,#39,#06,#80,#05,#39
	db #0c,#3b,#0b,#39,#0b,#3c,#0b,#39
	db #0c,#3e,#0b,#39,#0b,#40,#0c,#39
	db #0b,#3e,#0b,#39,#0c,#3c,#0b,#39
	db #0b,#3b,#0c,#3c,#0b,#34,#05,#80
	db #06,#34,#0c,#36,#0b,#34,#0b,#37
	db #0b,#34,#0c,#39,#0b,#37,#0b,#34
	db #06,#80,#05,#34,#0c,#36,#0b,#34
	db #0c,#37,#0b,#34,#0b,#39,#0b,#37
	db #0c,#34,#05,#80,#06,#34,#0b,#36
	db #0c,#34,#0b,#37,#0b,#34,#0c,#39
	db #0b,#34,#0b,#3b,#0b,#34,#0c,#39
	db #0b,#34,#0b,#37,#0c,#34,#0b,#36
	db #0b,#37,#0c,#80,#02,#ff
	dw l8561
	db #00,#00
;
.game_name
	db "Espionage",0
.game_year
	db "1988",0
.game_publisher
	db "Grandslam",0
.music_author
	db "Source",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
